<?php

    defined('BASEPATH') OR exit('No direct script access allowed');

    Class Template
    {

        var $template_data=array();
        var $template_view="template";

        function set($name, $value)
        {
            $this->template_data[$name]=$value;

        }

        function set_view($name)
        {
            $this->template_view=$name;

        }

        function load($view='', $view_data=array(), $return=FALSE)
        {
            $this->CI=& get_instance();

            // set session data for view
//            $view_data['session']=$this->CI->session->userdata('my_data');

            $this->set('contents', $this->CI->load->view($view, $view_data, TRUE));
            return $this->CI->load->view(''.$this->template_view, $this->template_data, $return);

        }

    }

?>
